<?php
namespace Home\Controller;
use Think\Controller;
class blogController extends Controller {
    public function lists(){
        $Newsmodel=M('blog');
        $count=$Newsmodel->where('id>0')->count();
        $Page = new \Think\Page1($count,2);
        $show = $Page->show();
        $data = $Newsmodel->where('id>0')->limit($Page->firstRow.','.$Page->listRows)->select();
        $this->assign('show',$show);
        $this->assign('data',$data);
        $this->display();
        }     
    public function read(){
        $Newsmodel=M(blog);
        $map['id']=I('get.id');
        $data=$Newsmodel->where($map)->find();
        $this->assign('data',$data);
        $this->display();
           }
}
